/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package oplm;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 *
 * @author hh
 */
@Entity
@Table(name = "TDOCUMENT", catalog = "", schema = "APP")
@NamedQueries({
    @NamedQuery(name = "Tdocument.findAll", query = "SELECT t FROM Tdocument t"),
    @NamedQuery(name = "Tdocument.findById", query = "SELECT t FROM Tdocument t WHERE t.id = :id"),
    @NamedQuery(name = "Tdocument.findByNm", query = "SELECT t FROM Tdocument t WHERE t.nm = :nm"),
    @NamedQuery(name = "Tdocument.findByAddDate", query = "SELECT t FROM Tdocument t WHERE t.addDate = :addDate"),
    @NamedQuery(name = "Tdocument.findByNote", query = "SELECT t FROM Tdocument t WHERE t.note = :note"),
    @NamedQuery(name = "Tdocument.findByKind", query = "SELECT t FROM Tdocument t WHERE t.kind = :kind")})
public class Tdocument implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Column(name = "NM")
    private String nm;
    @Column(name = "ADD_DATE")
    @Temporal(TemporalType.DATE)
    private Date addDate;
    @Column(name = "NOTE")
    private String note;
    @Column(name = "KIND")
    private Integer kind;

    public Tdocument() {
    }

    public Tdocument(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        changeSupport.firePropertyChange("id", oldId, id);
    }

    public String getNm() {
        return nm;
    }

    public void setNm(String nm) {
        String oldNm = this.nm;
        this.nm = nm;
        changeSupport.firePropertyChange("nm", oldNm, nm);
    }

    public Date getAddDate() {
        return addDate;
    }

    public void setAddDate(Date addDate) {
        Date oldAddDate = this.addDate;
        this.addDate = addDate;
        changeSupport.firePropertyChange("addDate", oldAddDate, addDate);
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        String oldNote = this.note;
        this.note = note;
        changeSupport.firePropertyChange("note", oldNote, note);
    }

    public Integer getKind() {
        return kind;
    }

    public void setKind(Integer kind) {
        Integer oldKind = this.kind;
        this.kind = kind;
        changeSupport.firePropertyChange("kind", oldKind, kind);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tdocument)) {
            return false;
        }
        Tdocument other = (Tdocument) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "oplm.Tdocument[ id=" + id + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
